
var gulp = require('gulp');
var postcss = require('gulp-postcss');
var autoprefixer = require('autoprefixer');
var rename = require('gulp-rename');
var mixins = require('postcss-mixins');
var vars = require('postcss-simple-vars');
var extend = require('postcss-extend');
var nested = require('postcss-nested');
var import2 = require('postcss-import');
var watch = require('gulp-watch');

gulp.task('css', function () {
  var processors = [autoprefixer({browsers:'safari >= 9,ie 6-8,iOS 7,> 0.01%'}),import2, vars,extend,nested,mixins];
  return gulp.src('./app.scss')
    .pipe(postcss(processors)).pipe(rename('app.wxss'))
    .pipe(gulp.dest('./'));

});
gulp.task('watch',function () {
  gulp.watch('./**/*.scss', ['css']);

})
gulp.task('default', ['css','watch']);